package com.bwie.bwedu.presenter.impl;

import com.bwie.bwedu.bean.Student;
import com.bwie.bwedu.fragment.InvalidFragment;
import com.bwie.bwedu.model.InvalidModel;
import com.bwie.bwedu.model.impl.InvalidModelImpl;
import com.bwie.bwedu.presenter.InvalidPresenter;
import com.bwie.bwedu.utils.LogUtils;

import java.util.ArrayList;

/**
 * Created by Administrator on 2016/7/23.
 */
public class InvalidPresenterImpl implements InvalidPresenter {

    private InvalidFragment fragment;
    private final InvalidModelImpl mode;

    public InvalidPresenterImpl(InvalidFragment fragment) {
        this.fragment = fragment;

        mode = new InvalidModelImpl();
    }

    @Override
    public void invalid(String flag, String pn) {
      mode.invalid(flag, pn, new InvalidModel.InvalidListener() {
          @Override
          public void onTackSuccess(ArrayList<Student> list) {
              LogUtils.e("sssssssssssssssssonTackSuccess");
              fragment.onSuccess(list);
              LogUtils.e("sssssssssssssssssonTackSuccess2");
          }

          @Override
          public void onTackFail(String fail) {
            fragment.onFail(fail);
          }
      });

    }
}
